package com.wzw.controller;

import com.wzw.dao.IUserDao;
import com.wzw.service.IMainService;
import com.wzw.service.impl.MainService;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.stereotype.Controller;

import java.lang.reflect.Proxy;

@Controller

public class MainController {
    public static void main(String[] args) {
//        IMainService service = new MainService();
//        String info = service.login();
//        System.out.println(info);

        ApplicationContext applicationContext =
                new ClassPathXmlApplicationContext("applicationContext.xml");
        String[] names = applicationContext.getBeanDefinitionNames();
        for (String name:names){
            System.out.println(name);
        }

        IMainService sev = (IMainService)applicationContext.getBean("mainService");
        System.out.println(sev.login());

//        System.out.println(sev.getDao().find());

    }
}
